package at.fhooe.stefanirndorfer.graphics;

import java.util.ArrayList;

public class RenderManager {

	ArrayList<Visual> vis;
	
	public RenderManager(){
		vis = new ArrayList<Visual>();
	}
	
	public synchronized void addVisual(Visual v){
		vis.add(v);
	}
	
	public synchronized void renderAll(){
			for(Visual v : vis){
				v.render();
			}
	}
	
	public synchronized void removeVisual(Visual v){
		for (int i = 0; i < vis.size(); i++) {
			if(vis.get(i).equals(v)){
				vis.remove(i);
				break;
			}
		}
	}
	
}
